<nav class="navbar navbar-expand-lg navbar-light bg-light navbar-static-top">
    <div class="container">
        <!-- Branding Image -->

        <a class="navbar-brand " href="{{ url('/') }}" style="margin-left:100px;font-size:14px;">
        <img src="/src/assets/logo.png" alt="" style="width:120px;margin-left:-180px;"> 您好,欢迎光临花果山！
        </a>

        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>

        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <!-- Left Side Of Navbar -->
            <ul class="navbar-nav mr-auto">

            </ul>

            <!-- Right Side Of Navbar -->
            <ul class="navbar-nav navbar-right">
                <!-- 登录注册链接开始 -->
                @guest
                    <li class="nav-item"><a class="nav-link" href="{{ route('login') }}">登录</a></li>
                    <li class="nav-item"><a class="nav-link" href="{{ route('register') }}">注册</a></li>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" >
                           个人中心
                        </a>
                        <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                         <a href="{{ route('user_addresses.index') }}" class="nav-link">收货地址</a>
                         <a href="{{ route('orders.index') }}" class="nav-link">我的订单</a>
                         <a href="{{ route('products.favorites') }}" class="nav-link">我的收藏</a>
                        </div>
                  </li>
                @else
                    <li class="nav-item">
                        <a class="nav-link mt-1" href="{{ route('cart.index') }}"><i class="fa fa-shopping-cart"></i></a>
                    </li>
                    <a class="nav-link" >
                            <img src="/src/assets/logo9.png" class="img-responsive img-circle" width="30px" height="30px">
                            {{ Auth::user()->name }}
                        </a>
                    <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"  data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" >
                            个人中心   </a>
                        <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                        <a href="{{ route('user_addresses.index') }}" class="nav-link">收货地址</a>
                        <a href="{{ route('orders.index') }}" class="nav-link">我的订单</a>
                        <a href="{{ route('products.favorites') }}" class="nav-link">我的收藏</a>
                         <!-- <a class="nav-link" id="logout" href="#"
                               onclick="event.preventDefault();document.getElementById('logout-form').submit();">退出登录</a>
                             <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
                                {{ csrf_field() }}
                            </form> -->
                        </div>
                        </li>
                        <li class="nav-item"> <a class="nav-link" id="logout" href="#"
                               onclick="event.preventDefault();document.getElementById('logout-form').submit();">退出登录</a> <li class="nav-item">
                             <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
                                {{ csrf_field() }}
                            </form>
                @endguest
                <!-- 登录注册链接结束 -->
            </ul>
        </div>
    </div>
</nav>
